//
//  CYBaseCollectionViewController.h
//  CYTabBarViewController
//
//  Created by lc4y on 2017/12/4.
//  Copyright © 2017年 weiwang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CYTabBar.h"

@protocol CYBaseCollectionViewControllerDelegate <NSObject>

- (void)topTitleViewMenuClick:(NSInteger)buttonIndex;
- (void)bottomViewMenuClick:(NSInteger)buttonIndex;

@end

@interface CYBaseCollectionViewController : UIViewController <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout> {
    NSArray *_cy_dataArray;
    // 头部滚动和底部滚动的视图 cy_collectionView
    UICollectionView *_cy_collectionView;
    
    //头部文字中间的间距
    CGFloat _itemSpace;
    
    //选中的当前页
    NSInteger _cy_currentIndex;
}

@property (nonatomic, weak) id <CYBaseCollectionViewControllerDelegate> delegate;

@property (nonatomic, assign) NSInteger cy_currentIndex;

- (void)cy_calcItemSpace;

- (void)cy_configLayoutSubViews;

- (void)setContentArray:(NSArray *)contentArray;

- (CGFloat)stringWidth:(NSString *)string;

- (void)cy_refreshCollectionCell:(UICollectionViewCell *)collectionCell indexPath:(NSIndexPath *)indexPath;

@end
